#version 330 core
in vec4 vertexColor;
in vec2 texCoord;

out vec4 FragColor;
uniform sampler2D ourTexcoord;


in vec3 modelPos;
in vec3 Normal;
in vec2 UV;

float near = 0.1;
float far  = 100.0;

//深度值计算
float linearDepth(float _z){
	//由于非线性方程与 1/z 成正比，在1.0和2.0之间的z值将会变换至1.0到0.5之间的深度值
	float z = _z * 2.0-1.0; //NDC(0,1)
	//计算方式
	return (2.0 * near * far) / (far + near - z * (far - near));
}
void main() {
	
		FragColor =texture(ourTexcoord, UV);
	//深度缓冲可视化
//	float depth = linearDepth(gl_FragCoord.z);
//	FragColor= vec4((vec3(depth)), 1.0);
}